package com.kuang.controller;

import com.kuang.entiy.PO.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

@Controller
public class DataDealController {
    @RequestMapping("/hello")
    public String hello(@RequestParam("username") String name, ModelMap model){
        System.out.println(name);
        Map<String, String> map = new HashMap<>();
        map.put("msg", "fsdffsd");
        model.addAllAttributes(map);
        return "test";
    }

    @RequestMapping("/user")
    public String user(User user){
        System.out.println(user.toString());
        return "test";
    }

}
